﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.hud.components {
    import flash.events.*;
    import Engine.Managers.*;
    import org.aswing.*;
    import Classes.*;
    import flash.filters.*;
    import Display.*;
    import Display.aswingui.*;
    import flash.external.*;

    public class HUDVisitingHomepageComponent extends HUDComponent {

        override public function isVisible():Boolean{
            return (((ExternalInterface.available) && (!((Global.getVisiting() == GameWorld.CITY_SAM_OWNER_ID)))));
        }
        override protected function buildComponent():void{
            var _local3:AssetPane;
            var _local1:GameSprite = new GameSprite();
            _local1.addChild(new EmbeddedArt.visitHomepageIcon());
            var _local2:String = ZLoc.t("Main", "visitFriendHomepage_ToolTip");
            _local1.toolTip = _local2;
            _local3 = new AssetPane(_local1);
            _local3.addEventListener(MouseEvent.MOUSE_OVER, this.onButtonMouseOver);
            _local3.addEventListener(MouseEvent.MOUSE_OUT, this.onButtonMouseOut);
            _local3.addEventListener(MouseEvent.CLICK, this.onClick);
            m_jPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.LEFT, 0);
            m_jPanel.append(_local3);
        }
        private function onButtonMouseOut(_arg1:MouseEvent):void{
            this.filters = null;
        }
        private function onButtonMouseOver(_arg1:MouseEvent):void{
            var _local2:GlowFilter = new GlowFilter(EmbeddedArt.HOVER_GLOW_COLOR, 1, 8, 8, 5);
            this.filters = [_local2];
        }
        private function onClick(_arg1:Event):void{
            ExternalInterface.call("visitFriendHomepage", Global.getVisiting());
            StatsManager.count("q_visit_neighbor", "friend_homepage");
        }

    }
}//package Display.hud.components 
